package com.hmc.modules.sjfx.service.lashent.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hmc.common.service.impl.CrudServiceImpl;
import com.hmc.common.constant.Constant;
import com.hmc.modules.sjfx.dao.lashen.LashenDao;
import com.hmc.modules.sjfx.dao.lashent.LashentDao;
import com.hmc.modules.sjfx.dto.glsjfx.GgHfDTO;
import com.hmc.modules.sjfx.dto.hgsjfx.TsElDTO;
import com.hmc.modules.sjfx.dto.hgsjfx.TsRateDTO;
import com.hmc.modules.sjfx.dto.hgsjfx.TsTsDTO;
import com.hmc.modules.sjfx.dto.hgsjfx.YsTsDTO;
import com.hmc.modules.sjfx.dto.lashent.LashentDTO;
import com.hmc.modules.sjfx.entity.lashent.LashentEntity;
import com.hmc.modules.sjfx.service.lashent.LashentService;
import com.hmc.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 拉伸提取数据
 *
 * @author hmc wengxiulinluman@qq.com
 * @since 3.0 2024-03-09
 */
@Service
public class LashentServiceImpl extends CrudServiceImpl<LashentDao, LashentEntity, LashentDTO> implements LashentService {

    @Autowired
    private LashentDao LashentDao;

    @Override
    public QueryWrapper<LashentEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<LashentEntity> wrapper = new QueryWrapper<>();

        String id = (String)params.get("id");
        wrapper.eq(StringUtils.isNotBlank(id), "ID", id);

        return wrapper;
    }


    /**
     * 获取钢管母材抗拉强度
     * @return
     */
    @Override
    public ArrayList<Double> getKlqdMc() {
        ArrayList<Double> klqdMc = LashentDao.getKlqdMc();
        return klqdMc;
    }

    /**
     * 获取钢管母材抗拉强度
     * @return
     */
    @Override
    public ArrayList<Double> getKlqdZc() {
        ArrayList<Double> klqdZc = LashentDao.getKlqdZc();
        return klqdZc;
    }

    /**
     * 获取钢管母材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getQqbMc() {
        ArrayList<Double> qqbMc = LashentDao.getQqbMc();
        return qqbMc;
    }

    /**
     * 获取钢管母材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getQqbZc() {
        ArrayList<Double> qqbZc = LashentDao.getQqbZc();
        return qqbZc;
    }

    /**
     * 获取钢管母材拉伸率
     * @return
     */
    @Override
    public ArrayList<Double> getLslMc() {
        ArrayList<Double> lslMc = LashentDao.getLslMc();
        return lslMc;
    }

    /**
     * 获取钢管主材拉伸率
     * @return
     */
    @Override
    public ArrayList<Double> getLslZc() {
        ArrayList<Double> lslZc = LashentDao.getLslZc();
        return lslZc;
    }

    /**
     * 获取鞍钢钢管母材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getAgQqbMc() {
        ArrayList<Double> agQqbMc = LashentDao.getAgQqbMc();
        return agQqbMc;
    }

    /**
     * 获取鞍钢钢管主材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getAgQqbZc() {
        ArrayList<Double> agQqbZc = LashentDao.getAgQqbZc();
        return agQqbZc;
    }

    /**
     * 获取湖南华菱湘潭钢管母材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getHnQqbMc() {
        ArrayList<Double> hnQqbMc = LashentDao.getHnQqbMc();
        return hnQqbMc;
    }

    /**
     * 获取湖南华菱湘潭钢管主材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getHnQqbZc() {
        ArrayList<Double> hnQqbZc = LashentDao.getHnQqbZc();
        return hnQqbZc;
    }

    /**
     * 获取上海宝钢钢管母材屈强比
     * @return
     */
    @Override
    public ArrayList<Double> getShBgQqbMc() {
        ArrayList<Double> shBgQqbMc = LashentDao.getShBgQqbMc();
        return shBgQqbMc;
    }

    /**
     * 获取上海宝钢钢管主材屈强比
     */
    @Override
    public ArrayList<Double> getShBgQqbZc() {
        ArrayList<Double> shBgQqbZc = LashentDao.getShBgQqbZc();
        return shBgQqbZc;
    }

    /**
     * 获取北京宝钢钢管母材屈强比
     */
    @Override
    public ArrayList<Double> getBjBgQqbMc() {
        ArrayList<Double> bjBgQqbMc = LashentDao.getBjBgQqbMc();
        return bjBgQqbMc;
    }

    /**
     * 获取北京宝钢钢管主材屈强比
     */
    @Override
    public ArrayList<Double> getBjBgQqbZc() {
        ArrayList<Double> bjBgQqbZc = LashentDao.getBjBgQqbZc();
        return bjBgQqbZc;
    }

    /**
     * 获取数据：
     * 屈服强度 YS
     * 抗拉强度 TS
     * 屈强比 YIELD_RATE
     * 拉伸率 EL
     */
    @Override
    public ArrayList<GgHfDTO> getGlsjfxKlqd() {
        ArrayList<GgHfDTO> list = LashentDao.getGlsjfxKlqd();
        return list;
    }

    /**
     * 获取数据：
     * 屈服强度 YS
     * 抗拉强度 TS
     * 屈强比 YIELD_RATE
     * 拉伸率 EL
     */
    @Override
    public ArrayList<Double[]> getLashent() {
        ArrayList<Double[]> list = LashentDao.getLashent();
        return list;
    }

    /**
     * 获取 钢管 屈服强度和抗拉强度
     */
    @Override
    public ArrayList<YsTsDTO> getGgYsTs() {
        ArrayList<YsTsDTO> list = LashentDao.getGgYsTs();
        return list;
    }

    /**
     * 获取 钢管抗拉强度和原料抗拉强度
     *
     * @return
     */
    @Override
    public ArrayList<TsTsDTO> getGgTsTs() {
        ArrayList<TsTsDTO> list = LashentDao.getGgTsTs();
        return list;
    }

    /**
     * 获取 钢管抗拉强度和原料屈强比
     */
    @Override
    public ArrayList<TsRateDTO> getGgTsRate() {

        ArrayList<TsRateDTO> list = LashentDao.getGgTsRate();
        return list;
    }

    /**
     * 获取 钢管抗拉强度和原料拉伸率
     */
    @Override
    public ArrayList<TsElDTO> getGgTsEl() {

        ArrayList<TsElDTO> list = LashentDao.getGgTsEl();
        return list;
    }
}